{% extends "master.html" %}
{% block subtitle %} - 主面板 - 财务管理 - 应收{% endblock %}

{% block main %}
<div class="container">
    <div class="row">
        <ul class="breadcrumb">
          <li><a href="{{url_for('bpRoot.view')}}">主面板</a> <span class="divider">\</span></li>
          <li class="active">财务管理(应收)</li>
        </ul>
    </div>
    
    <div class="row">
        <ul class="nav nav-tabs">
          <li class="active"><a href="#">应收信息</a></li>
          {% if getAllPermission(['FIN_OUT_VIEW',]) %}
            <li><a href="{{url_for('.view',action='index_out')}}">应付信息</a></li>
          {% endif %}
          <li><a href="{{url_for('.view',action='account')}}">账户信息</a></li>
        </ul>
    </div>
    
    
    <div class="row">
        {{mymacros.render_search_form(form,3)}}
    </div>           
    <div class="row">
        <div class="btn-toolbar pull-right">
            <div class="btn-group"><button type="button" class="btn" onclick="$('form').submit()">查询记录</button></div>
            {% if getAllPermission(['FIN_IN_CREATE',]) %}
                <div class="btn-group"><a href="{{url_for('.view',action='add',t=FIN_IN)}}" class="btn btn-primary">创建应收账单</a></div>
            {% endif %}
        </div>
    </div>     
    <div class="row">
        <table class="table table-bordered">
            <thead>
            <tr>
                <td class="span2">系统编号</td>
                <td class="span2">发票号码</td>
                <td>抬头</td>
                <td>涉及</td>
                <td class="span1">金额</td>
                <td class="span1">状态</td>
                <td class="span2">经办人</td>
                <td class="span2">开票时间</td>
            </tr>
            </thead>
            <tbody>
                {% for r in result.items %}
                    <tr>
                        <td><a href="{{url_for('bpFin.view',action='view',id=r.id)}}">{{r.no}}</a></td>
                        <td>{{r.invoiceNo|f}}</td>
                        <td>{{r.issueTo|f}}</td>
                        <td>
                            {{ mymacros.render_goto_popup(r.refer, loop.first) }}
                        </td>
                        <td>{{r.amount}}</td>
                        <td>{{r.status|ss(c='FIN')}}</td>
                        <td>{{r.createBy}}</td>
                        <td>{{r.createTime|ft}}</td>
                    </tr>
                {% endfor %}
        </table>
        {{mymacros.mypaginate(result)}}
    </div>

</div>
{% endblock %}